SYNTAXDEF ol
FOR <http://apc.utwente.nl/OrchestrationLanguage>
START Modules


OPTIONS {
	overrideBuilder = "false";
}

TOKENS {
	DEFINE COMMENT $'//'(~('\n'|'\r'|'\uffff'))*$;
	DEFINE INTEGER $('-')?('1'..'9')('0'..'9')*|'0'$;
	DEFINE FLOAT $('-')?(('1'..'9') ('0'..'9')* | '0') '.' ('0'..'9')+ $;
}


TOKENSTYLES {
	"ExternalServices" COLOR #7F0055, BOLD;
	"name" COLOR #7F0055, BOLD;
	"Location" COLOR #7F0055, BOLD;
	"operations" COLOR #7F0055, BOLD;
	"InternalServices" COLOR #7F0055, BOLD;
	"main" COLOR #7F0055, BOLD;
	"uses" COLOR #7F0055, BOLD;
	"internalOperations" COLOR #7F0055, BOLD;
	"Main" COLOR #7F0055, BOLD;
	"Process" COLOR #7F0055, BOLD;
	"parameters" COLOR #7F0055, BOLD;
	"Variable_Assignment" COLOR #7F0055, BOLD;
	"assign" COLOR #7F0055, BOLD;
	"Variable_Declaration" COLOR #7F0055, BOLD;
	"declare" COLOR #7F0055, BOLD;
	"Call" COLOR #7F0055, BOLD;
	"input" COLOR #7F0055, BOLD;
	"target" COLOR #7F0055, BOLD;
	"Module" COLOR #7F0055, BOLD;
	"provide" COLOR #7F0055, BOLD;
	"imports" COLOR #7F0055, BOLD;
	"Import" COLOR #7F0055, BOLD;
	"references" COLOR #7F0055, BOLD;
	"Variable" COLOR #7F0055, BOLD;
	"If" COLOR #7F0055, BOLD;
	"else" COLOR #7F0055, BOLD;
	"condition" COLOR #7F0055, BOLD;
	"ifExecute" COLOR #7F0055, BOLD;
	"Else" COLOR #7F0055, BOLD;
	"elseExecute" COLOR #7F0055, BOLD;
	"Argument" COLOR #7F0055, BOLD;
	"assignFrom" COLOR #7F0055, BOLD;
	"assignTo" COLOR #7F0055, BOLD;
	"Modules" COLOR #7F0055, BOLD;
	"contains" COLOR #7F0055, BOLD;
	"InternalProcess" COLOR #7F0055, BOLD;
	"sequence" COLOR #7F0055, BOLD;
}


RULES {
	Variable_Assignment ::= "Variable_Assignment" "{" ("assign" ":" assign[])* "}";
	Variable_Declaration ::= "Variable_Declaration" "{" ("declare" ":" declare[])* "}";
	Variable ::= "Variable" "{" ("name" ":" name['"','"'])* "}";
	
	Modules ::= contains*;
	Module ::= "module" name[] "{" imports* provide* "}";
	Import ::= "import" references[] ";";
	ExternalServices ::= "service" name[] "@" Location['<','>'] "{" operations+ "}";
	InternalServices ::= main? "service" name[] ("uses" uses[]+)? "{" internalOperations+ "}";
	Main ::= "main";
	Process ::= name[]"(" parameters* ");";
	InternalProcess ::= name[]"(" parameters* ")" "{" sequence+ "}";
	Call ::= target[] "(" input[]? ");";
	Argument ::= (assignTo[] "=" assignFrom[] (",")?)* "}";
	If ::= "if" "(" condition[] ")" "{" ifExecute+ "}" else[]?;
	Else ::= "else" "{" elseExecute+ "}";
}